package com.ruoyi.medicine.mapper;

import com.ruoyi.medicine.domain.HisMedicineCart;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @program: RuoYi-Vue-master
 * @ClassName HisMedicineCartMapper
 * @description:
 * @author: xiaoJie
 * @create: 2024-09-01 14:09
 * @Version 1.0
 */
public interface HisMedicineCartMapper {
    //通过用户id查询是否有购物车
    @Select("select * from his_medicine_cart where userId = #{userId}")
    HisMedicineCart selectMedicineCartId(Long userId);
    //添加购物车
    @Insert("insert into his_medicine_cart values (default,#{userId},#{cart},#{remark})")
    int insetMedicineCart(HisMedicineCart hisMedicineCart);
    //修改购物车数量
    @Update("update his_medicine_cart set cart = #{cart} where id = #{id}")
    int updateMedicineCart(HisMedicineCart hisMedicineCart);

}
